package com.admin.common.enums;

/**
 * 验证码配置枚举
 *
 * @author sq-lan
 */

public enum LoginCodeEnum {

    /**
     * 算数
     */
    ARITHMETIC("arithmetic", "算数"),

    /**
     * 中文
     */
    CHINESE("chinese", "中文"),

    /**
     * 中文闪图
     */
    CHINESE_GIF("chinese_gif", "中文闪图"),

    /**
     * 闪图
     */
    GIF("gif", "闪图"),

    SPEC("spec", "spec"),
    ;

    private String code;

    private String label;

    public String getCode() {
        return code;
    }

    public String getLabel() {
        return label;
    }

    LoginCodeEnum(String code, String label) {
        this.code = code;
        this.label = label;
    }

    public static LoginCodeEnum getByCode(String code) {
        for (LoginCodeEnum entry : LoginCodeEnum.values()) {
            if (entry.getCode().equals(code)) {
                return entry;
            }
        }
        return null;
    }
}
